From: Lars Hansen Date: Wed, 5 Nov 2003 13:28:17 +0000 (+0000) Subject: (desktop-locals-to-save): Add buffer-file-coding-system. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~25058 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=e963779332cd7f9407a71edb52ca427b715fcf23;p=emacs.git (desktop-locals-to-save): Add buffer-file-coding-system. (desktop-buffer-file): Use saved buffer-file-coding-system for file reading. Set auto-insert to nil to prevent automatic insertion into restored empty files. --- diff --git a/lisp/desktop.el b/lisp/desktop.el index 73fef5c44b7..0cff5e5a21f 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -227,7 +227,8 @@ This variable is maintained for backward compatibility only. Use fill-column overwrite-mode change-log-default-name - line-number-mode) + line-number-mode + buffer-file-coding-system) "List of local variables to save for each buffer. The variables are saved only when they really are local." :type '(repeat symbol) @@ -872,7 +873,12 @@ directory DIRNAME." (y-or-n-p (format "File \"%s\" no longer exists. Re-create? " desktop-buffer-file-name)))) - (let ((buf (find-file-noselect desktop-buffer-file-name))) + (let* ((auto-insert nil) ; Disable auto insertion + (coding-system-for-read + (or coding-system-for-read + (cdr (assq 'buffer-file-coding-system + desktop-buffer-locals)))) + (buf (find-file-noselect desktop-buffer-file-name))) (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf)))